#include <iostream>
#include <algorithm>
using namespace std;

const int N = 1010;

struct node{
	int num, t;
//	bool operator<(const node& x) const
//	{
//		return t > x.t;
//	}
}a[N];

bool cmp(node& x, node& y)
{
	return x.t < y.t;
}

int n;

int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++)
	{
		cin >> a[i].t;
		a[i].num = i; 
	}
	sort(a + 1, a + 1 + n, cmp);
	double sum = 0;
	for(int i = 1; i <= n; i++)
	{
		cout << a[i].num << " ";
		sum += (a[i].t * (n - i));
	} 
	cout << endl;
//	cout << sum / n << endl;
	printf("%.2lf\n", sum / n);
	return 0;
}
